home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / ps68a12.zip / A68.DOC < prev    next >
Text File  |  1987-03-15  |  38KB  |  1,103 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                              PseudoSam 68 Assembler Manual V1.2.02
  12.                              Copyright(c) 1986 PseudoCode
  13.  
  14.  
  15.  
  16.  
  17.  
  18. Disclaimer:
  19.  
  20.             PseudoSam 68 is distributed as is, with no guarantee that it
  21.             will work correctly in all situations.  In no event will the
  22.             Author be liable for any damages, including lost profits,
  23.             lost savings or other incidental or consequential damages
  24.             arising out of the use of or inability to use these
  25.             programs, even if the Author has been advised of the
  26.             possibility of such damages, or for any claim by any other
  27.             party.
  28.  
  29.             It is the users reponsibility to back up all important files!
  30.  
  31.             See copyright information in appendix B
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                          Table of Contents
  38.  
  39. Chapter 1  PseudoSam 68 assembler vs. the Motorola assembler.
  40.  
  41. Chapter 2  Running the assembler program.
  42.  
  43. Chapter 3  Assembler statement syntax.
  44.  
  45. Chapter 4  Data types.
  46.  
  47. Chapter 5  Expressions.
  48.  
  49. Chapter 6  Assembler Directives.
  50.   (also known as assembler pseudo-opcodes, or pseudo-ops)
  51.  
  52. Appendix A      ASCII character set.
  53.  
  54. Appendix B      Copyright and registration information.
  55.  
  56. Appendix C      Description of Files.
  57.  
  58. Appendix D      Bug Reporting Procedure.
  59.  
  60. Appendix E      Using PseudoSam 68 on "Compatible" Systems.
  61.  
  62.  
  63.  
  64. Chapter 1 PseudoSam 68 assembler vs. the Motorola assembler
  65.  
  66.      All PseudoSam(Pseudo brand Symbolic AsseMbler) assemblers conform to
  67.      a common syntax based on the UNIX system V assembler syntax. By
  68.      conforming to this Pseudo standard, conflicts with the manufacturers
  69.      syntax are created.  Below is a brief and incomplete list of those
  70.      conflicts.
  71.  
  72.       Motorola format                     PseudoSam format
  73.  
  74. <identifier> equ <expression>         .equ <identifier> , <expression>
  75.  
  76. <identifier> set <expression>         .set <identifier> , <expression>
  77.  
  78. Has Macro capability                  No Macro capability at this time
  79.  
  80. Labels start in column 1 of           Labels may start anywhere, but must
  81. the source line.                      be followed immediately by a colon.
  82.  
  83.  
  84.  
  85. * The difference between the Motorola and the PseudoSam name
  86.   of an assembler directive can be circumvented by the .opdef
  87.   directive.
  88.  
  89.   example
  90.  
  91.    .opdef  eject,.eject      ;defines eject to be synonymous with .eject
  92.    .opdef  fcc,.db           ;fcc will now form constant characters as it
  93.                              ;should.
  94.  
  95. *  A file syn.asm is distributed with the assembler with some useful
  96.    redefinitions.
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107. Unix system V is a trademark of AT & T.
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. Chapter 2  Running the assembler program
  116.  
  117. 1.  Command line switch setting and source file specification.
  118.  
  119.      Assuming the user has an assembly language source file called foo.asm
  120.      type the following command:
  121.  
  122. a68 foo
  123.  
  124.      The assembler will assemble the program foo.asm using the default
  125.      assembler switch settings. the following files will be generated
  126.      by the assembler:
  127.  
  128.      foo.lst   ;assembled listing shown the code conversion and
  129.                ; any errors that where discover by the assembler.
  130.  
  131.      foo.obj   ;assembled object code in Motorola Hex format.
  132.  
  133. **  for a list of switch setting see the .command assembler directive
  134.     description in chapter 6.
  135.  
  136. *** The assembler uses the following temporary file names.
  137.  
  138.     z0z0z0z0.tmp
  139.     z1z1z1z1.tmp
  140.  
  141.     ANY files with these names will be DESTROYED by the
  142.     by the assembler.
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150. Chapter 3  Assembler statement syntax
  151.  
  152. 1. Assembler Statements
  153.  
  154.      Assembler statements contain from zero to 4 fields as shown in
  155.      following.
  156.  
  157. <label> <opcode> <expressions> <comment>
  158.  
  159.      All fields are optional, but they must be in this order.
  160.  
  161. A.   Labels (<label>) are symbolic names that are assigned the starting
  162.      address of any code generated by the opcode and or expressions
  163.      of the line containing the label declaration.(see section 2).
  164.  
  165. B.   Operation codes(<opcode>) tell the assembler what machine instruction
  166.      to generate, or what assembler control function to perform.
  167.      The operation code also tells the assembler what expressions are
  168.      required to complete the machine instruction or assembler directive.
  169.      (see chapter 6).
  170.  
  171. C.   Expression requirements are set by the opcode(see the microprocessor
  172.      manufacturers reference manual or the assembler directives chapter
  173.      for individual opcode requirements).(see chapter 5).
  174.  
  175. D.   Comments are notes written by the programmer to explain what the
  176.      program is trying to accomplish. Comments generate no code.
  177.      (see section 3).
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185. 2.  Labels
  186.  
  187.      Labels can be unlimited in length, but only the first eight characters
  188.      are used to distinguish between them.  They must conform to the
  189.      following syntax.
  190.  
  191.      <label>  -> <identifier>':'
  192.  
  193.      <identifier> -> <alphabetic character> <identifier character string>
  194.  
  195.      <alphabetic character> -> character in the set ['A'..'Z', 'a'..'z', '.']
  196.  
  197.      <identifier character string> -> any sequence of characters from the
  198.                                       set ['A'..'Z','a'..'z', '.', '0'..'9']
  199.  
  200. example
  201. abc:                  ;label referred to as abc
  202. a c:                  ;not a valid label
  203.          foo:         ;label referred to as foo
  204. .123:                 ;label referred to as .123
  205.  
  206. * Case makes NO difference!
  207.  
  208. d:      ;is the same as
  209. D:
  210.  
  211.  
  212. 3.  Comments
  213.      Comments must start with a semi-colon ; and are terminated
  214.      by an end of line or file( <lf>(^J) or <sub>(^Z) ). An end
  215.      of line is inserted by typing the enter or return key by
  216.      most text editors.
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224. Chapter 4     Data types
  225.  
  226. 1.  Integers
  227.  
  228.     Integer constants can be specified in any of the following forms:
  229.  
  230. A.  Binary
  231.  
  232.     b'bb             ;bb=string of binary digits
  233.     B'bb
  234.  
  235. B.  Decimal
  236.  
  237.     ndd
  238.     d'dd             ;n=nozero decimal digit
  239.     D'dd             ;dd=string of decimal digits
  240.  
  241. C.  Octal
  242.  
  243.     0qq              ;qq=string of octal digits
  244.     o'qq
  245.     O'qq
  246.     q'qq
  247.     Q'qq
  248.  
  249. D.  Hexidecimal
  250.  
  251.     0x'hh            ;hh=string of hexidecimal digits
  252.     0X'hh
  253.     h'hh
  254.     H'hh
  255.     x'hh
  256.     X'hh
  257.  
  258.  
  259. Examples:
  260.  
  261.     077        ;octal number 77 = decimal 63
  262.     b'0101     ;binary number 101 = decimal 5
  263.     77         ;decimal number 77 = octal 115
  264.     h'ff       ;hexidecimal ff = decimal 255
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. 2.  Strings:
  272.  
  273.     Strings consist of a beginning quote " followed by any reasonable number
  274.     of characters followed by an ending quote ". Control characters and double
  275.     quotes " and backslash \ may not be used in strings directly.  These
  276.     special characters are included by using a special escape sequence which
  277.     the assembler translates into the appropriate ASCII code.
  278.  
  279. Note: Strings may not be used in expressions!
  280.       Although character constants may(see below).
  281.  
  282. Escape sequences
  283.   "\"" string containing "
  284.   "\\" string containing \
  285.   "\'" string containing '
  286.   "\0" string containing null
  287.   "\n" string containing linefeed
  288.   "\r" string containing carriage return
  289.   "\f" string containing formfeed
  290.   "\t" string containing horizontal tab
  291.   "\nnn" string containing the ASCII character who's code is o'nnn
  292.          (nnn are octal digits).
  293.   * see appendix A for ASCII codes.
  294.  
  295. 3.  Character Constants:
  296.  
  297.     Character constants consist of  a single quote ' followed by
  298.     a character or an escape sequence(see above) followed by a
  299.     single quote '.
  300.  
  301. example:
  302.    'A' = ASCII character value for the letter A = 65 (decimal);
  303.    '\''= ASCII character value for the character ' = 39 (decimal).
  304.  
  305. Character constants are treated as integers by the assembler and
  306. are valid where ever an integer value is valid.
  307.  
  308. example:
  309.    'A' + 1 = 66
  310.  
  311.   * see appendix A for ASCII codes.
  312.  
  313. 4.  Symbolic values
  314.  
  315.     Symbolic values are generally labels, but may be any identifier
  316.     assigned an integer value(using .